<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title></title>
<link rel="stylesheet" href="HNUST/../../user/css/pintuer.css">
<link rel="stylesheet" href="HNUST/../../user/css/admin.css">
<script src="HNUST/../../user/js/jquery.js"></script>
<script src="HNUST/../../user/js/pintuer.js"></script>
<script type="text/javascript">
function insert(){	
	
		$.ajax({
			url:"/HNUST/user/userinsert",
			type:"POST",
			data:{"userName" : $("#userName").val(),"password" : $("#password").val()},
			dataType:"json",
			
			success:function(data){
				if(data.success == "1"){
					alert("添加成功");
					window.history.back(-1);
					
				}else{
					alert("格式错误");
					
				}
				
			},
			error:function(data){
				alert("服务异常");
				location.reload(true);
			}
		});
	}
</script>
</head>
<body>
<div class="panel admin-panel">
  <div class="panel-head" id="add"><strong><span class="icon-pencil-square-o"></span>增加内容</strong></div>
  <div class="body-content">
    <form method="post" class="form-x"> 
   
      <div class="form-group">
        <div class="label">
          <label>用户名：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" value="" name="userName" id="userName" data-validate="required:请输入用户名" />
          <div class="tips"></div>
        </div>
      </div>
      
       <div class="form-group">
        <div class="label">
          <label>密码：</label>
        </div>
        <div class="field">
          <input type="password" class="input w50" id="password" value="" name="password" data-validate="required:请输入密码" maxlength="11"/>
          <div class="tips"></div>
        </div>
      </div>
           
      
      
      <div class="form-group">
        <div class="label">
          <label></label>
        </div>
        <div class="field">
          <button class="button bg-main icon-check-square-o" type="button" onclick="insert();"> 提交</button>
        </div>
      </div>
    </form>
  </div>
</div>

</body></html>